package cn.edu.suda.catalina.dataupdate.util;

/**
 * Created by admin on 2017/6/2.
 */
public class ClassNameUtil {

    public static String getFullName(String originalFilename) {
        String prefix = "cn.edu.suda.catalina.dataupdate.script.";
        return prefix + originalFilename.split("\\.")[0];
    }

    public static String getNameWithoutExtensions(String originalFilename) {
        return originalFilename.split("\\.")[0];
    }

    public static String getSimpleName(String fullName) {
        return fullName.substring(fullName.lastIndexOf(".") + 1, fullName.length()) + ".java";
    }

    public static String getBakName(String fullName) {
        return fullName.substring(fullName.lastIndexOf(".") + 1, fullName.length()) + ".java.bak";
    }

    public static String getClassName(String fullName) {
        return fullName.substring(fullName.lastIndexOf(".") + 1, fullName.length()) + ".class";
    }
}
